﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using System.Web.Routing;
using InnovaApp.Layers.CommonLayer.Models;
using INNOVACALL.Framework.Common;
using InnovaApp.Layers.ResourcesLayer.Properties;
using INNOVACALL.Framework.Common.MVCHelpers.Localization;
using InnovaApp.Layers.DataLayer;

namespace InnovaApp.Layers.CommonLayer.Controllers
{
    public class HttpErrorController : _Controllers_Base<HttpErrorModel>
    {
        protected override void Initialize(System.Web.Routing.RequestContext requestContext)
        {
            base.eMethodBase = "INNOVACALL.Framework.Common.Controllers.HttpErrorController";
            base.specificCssCollection = new string[] { "_FormCommon.css", "Views/Home.css", "ClientComponents/CodeFormatting/csharp.css", "ClientComponents/KendoUI/kendo.common.min.css", "ClientComponents/KendoUI/kendo.blueopal.min.css" };
            base.specificJSCollection = null;
            base.dynamicJSCollection = new string[] { "/ScriptsG/inoHomeDynamic.js" };
            base.specificJqueryJSCollection = new string[] { "ClientComponents/KendoUI/kendo.web.min.js", "InnovacallJS/Home/Home.js" };
            base.externalCSS = null;
            base.Meta.Add(enMeta.Description, Resources.View_HttpError_Meta_Description);
            base.Meta.Add(enMeta.Keywords, Resources.View_HttpError_Meta_Keywords);
            base.Meta.Add(enMeta.Subject, Resources.View_HttpError_Meta_Subject);

            base.Initialize(requestContext);
        }

        // GET: /Error/HttpError
        public ActionResult index()
        {
            var ex = Server.GetLastError();
            using (DataRepositories _dataContext = new DataRepositories())
            {

                base.InitView(
                    string.Format(Resources.View_HttpError_PageTitle, 500),
                    CommonLocalization.LookupResource(typeof(Resources), string.Format("View_HttpError_{0}", "[ToDoHttpErrorCode]")),
                    specificCssCollection,
                    specificJSCollection,
                    dynamicJSCollection,
                    specificJqueryJSCollection,
                    jsVariables,
                    externalCSS,
                    Meta,
                    _dataContext,
                    false
                    );
            }
            //ContentData.HttpErrorId = ControllerContext.HttpContext.Error.Data
            ContentData.Message = "[ToDoMessage]";
            return View(ContentData);
        }
    }
}
